package cn.com.dhcc.ddi.datasource.vo;

import java.util.Date;
import java.util.List;

import cn.com.dhcc.app.core.annotation.SiColumn;
import cn.com.dhcc.app.core.annotation.SiNotDbColumn;
import cn.com.dhcc.app.core.annotation.SiTable;
import cn.com.dhcc.app.core.base.ModuleFeatureBean;
import cn.com.dhcc.app.core.util.JsonUtil;

/**
 * 
 * @ClassName: DataSourceVo
 * @Description: 数据源信息类
 * @author fxx
 * @date 2016-11-16
 * 
 */
@SiTable(name = "t_ddi_datasource")
public class DataSourceVo extends ModuleFeatureBean{
	@SiColumn(isId = true)
	private String id;
	@SiColumn(name = "node_id")
	private String nodeId;//所属节点
	@SiNotDbColumn
	private String nodeName;//节点名称
	private String name;//数据源名称
	private String type;//数据源类型
	private String conf;//数据源配置信息
	private String status;
	private Date mtime;//最后修改时间
	private String remark;
	@SiNotDbColumn
	private DataSourceConfVo dataSourceConfVo;
	@SiNotDbColumn
	private List<TableInfoVo> tableInfoVos;
	@SiNotDbColumn
	private String needAlert;//是否需要在监控页面告警
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getNodeId() {
		return nodeId;
	}
	public void setNodeId(String nodeId) {
		this.nodeId = nodeId;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getConf() {
		return conf;
	}
	public void setConf(String conf) {
		this.conf = conf;
	}
	public Date getMtime() {
		return mtime;
	}
	public void setMtime(Date mtime) {
		this.mtime = mtime;
	}
	public DataSourceConfVo getDataSourceConfVo() {
		return dataSourceConfVo;
	}
	public void setDataSourceConfVo(DataSourceConfVo dataSourceConfVo) {
		if(dataSourceConfVo != null){
			this.conf = JsonUtil.toJson(dataSourceConfVo);
		}
		this.dataSourceConfVo = dataSourceConfVo;
	}
	public List<TableInfoVo> getTableInfoVo() {
		return tableInfoVos;
	}
	public void setTableInfoVo(List<TableInfoVo> tableInfoVos) {
		this.tableInfoVos = tableInfoVos;
	}
	public String getNodeName() {
		return nodeName;
	}
	public void setNodeName(String nodeName) {
		this.nodeName = nodeName;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public String getNeedAlert() {
		return needAlert;
	}
	public void setNeedAlert(String needAlert) {
		this.needAlert = needAlert;
	}
	@Override
	public String toString() {
		return "DataSourceVo [id=" + id + ", nodeId=" + nodeId + ", nodeName="
				+ nodeName + ", name=" + name + ", type=" + type + ", conf="
				+ conf + ", status=" + status + ", mtime=" + mtime
				+ ", remark=" + remark + ", dataSourceConfVo="
				+ dataSourceConfVo + ", tableInfoVos=" + tableInfoVos
				+ ", needAlert=" + needAlert + "]";
	}

}
